<template>
  <div>
    <div v-for="item in nodes" :key="item.id">
      <el-submenu :index="item.id" v-if="item.children.length">
        <template slot="title">
          <i v-if="item.icon" :class="item.icon"></i>
          <span>{{item.name}}</span>
        </template>
        <ue-menu :nodes="item.children"></ue-menu>
      </el-submenu>
      <el-menu-item v-else :index="item.path">
        <i v-if="item.icon" :class="item.icon"></i>
        <span>{{item.name}}</span>
      </el-menu-item>
    </div>
  </div>
</template>

<script>
export default{
  props: ['nodes']
};
</script>
